Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/clean-coords

Package Overview
Dependencies
Maintainers
9
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/clean-coords

turf clean-coords module

  • 7.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
923K
increased by23.76%
Maintainers
9
Weekly downloads
 
Created

What is @turf/clean-coords?

@turf/clean-coords is a module from the Turf.js library that is used to clean coordinates in GeoJSON data. It removes redundant coordinates, such as consecutive duplicate points, and ensures the data is optimized for further processing or visualization.

What are @turf/clean-coords's main functionalities?

Remove Redundant Coordinates

This feature removes consecutive duplicate coordinates from a GeoJSON LineString. The input line has redundant points which are removed in the cleaned output.

const turf = require('@turf/turf');

const line = turf.lineString([
  [0, 0], [1, 1], [1, 1], [2, 2], [3, 3], [3, 3], [4, 4]
]);

const cleaned = turf.cleanCoords(line);
console.log(cleaned);

Clean Polygon Coordinates

This feature cleans redundant coordinates from a GeoJSON Polygon. The input polygon has duplicate points which are removed in the cleaned output.

const turf = require('@turf/turf');

const polygon = turf.polygon([
  [
    [0, 0], [1, 1], [1, 1], [1, 0], [0, 0], [0, 0]
  ]
]);

const cleaned = turf.cleanCoords(polygon);
console.log(cleaned);

Other packages similar to @turf/clean-coords

Keywords

FAQs

Package last updated on 09 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc